/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.pacis.shca.domain.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author solriver
 */
@Entity
@Table(name = "observacion_salud", catalog = "bdshca")
@NamedQueries({
    @NamedQuery(name = "ObservacionSalud.findAll", query = "SELECT o FROM ObservacionSalud o"),
    @NamedQuery(name = "ObservacionSalud.findByIdObservacionSalud", query = "SELECT o FROM ObservacionSalud o WHERE o.idObservacionSalud = :idObservacionSalud"),
    @NamedQuery(name = "ObservacionSalud.findByObsEnfermoUltimos3Meses", query = "SELECT o FROM ObservacionSalud o WHERE o.obsEnfermoUltimos3Meses = :obsEnfermoUltimos3Meses"),
    @NamedQuery(name = "ObservacionSalud.findByObsAcudioSalud", query = "SELECT o FROM ObservacionSalud o WHERE o.obsAcudioSalud = :obsAcudioSalud"),
    @NamedQuery(name = "ObservacionSalud.findByObsObservacion", query = "SELECT o FROM ObservacionSalud o WHERE o.obsObservacion = :obsObservacion")})
public class HealthObservation implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_observacion_salud")
    private Integer id;
    @Column(name = "obs_enfermo_ultimos_3_meses")
    private Boolean sickLast3Months;
    @Column(name = "obs_acudio_salud")
    private Boolean visitedHealthService;
    @Column(name = "obs_observacion")
    private String observation;
    @JoinColumn(name = "vis_id_visita_domiciliaria", referencedColumnName = "id_visita_domiciliaria")
    @ManyToOne(optional = false)
    private HomeVisit homeVisit;
    @JoinColumn(name = "mie_id_miembro", referencedColumnName = "id_miembro")
    @ManyToOne(optional = false)
    private Member member;

    public HealthObservation() {
    }

    public HealthObservation(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Boolean getSickLast3Months() {
        return sickLast3Months;
    }

    public void setSickLast3Months(Boolean sickLast3Months) {
        this.sickLast3Months = sickLast3Months;
    }

    public Boolean getVisitedHealthService() {
        return visitedHealthService;
    }

    public void setVisitedHealthService(Boolean visitedHealthService) {
        this.visitedHealthService = visitedHealthService;
    }

    public String getObsObservacion() {
        return observation;
    }

    public void setObservation(String observation) {
        this.observation = observation;
    }

    public HomeVisit getHomeVisit() {
        return homeVisit;
    }

    public void setHomeVisit(HomeVisit homeVisit) {
        this.homeVisit = homeVisit;
    }

    public Member getMember() {
        return member;
    }

    public void setMember(Member member) {
        this.member = member;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HealthObservation)) {
            return false;
        }
        HealthObservation other = (HealthObservation) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.pacis.shca.domain.entity.HealthObservation[ id=" + id + " ]";
    }
    
}
